﻿using farming.Admins.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;

namespace farming.Admins
{
    /// <summary>
    /// 管理员
    /// </summary>
    public class Admin : FullAuditedAggregateRoot<Guid>
    {
        /// <summary>
        /// 主键
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [RegularExpression("^[A-Za-z0-9~!@#$%^&*()_+-=,.<>/?;:'\"\\[\\]{}|\\\\]*$", ErrorMessage = "")]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string FullName { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime? Birthday { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public Sex Sex { get; set; }
        /// <summary>
        /// 末次登录时间
        /// </summary>
        public DateTime? LastLoginTime { get; set; }
        /// <summary>
        /// 末次登录IP
        /// </summary>
        public string LastLoginIp { get; set; }
        /// <summary>
        /// 锁定时间
        /// </summary>
        public DateTime? LockTime { get; set; }
        /// <summary>
        /// 登录错误次数
        /// </summary>
        public byte ErrorLoginNum { get; set; }
        /// <summary>
        /// 是否锁定
        /// </summary>
        public bool IsLock { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string Avatar { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string Introduction { get; set; }
    }
}
